
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:sec="http://www.springframework.org/security/facelets/tags">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" type="text/css"
		href="#{request.contextPath}/style/default.css" media="screen" />
	<link rel="shortcut icon"
		href="#{request.contextPath}/imgs/favicon.ico" type="image/x-icon" />

	<script type="text/javascript"
		src="#{request.contextPath}/js/jquery.format-1.2.js"></script>
	<script type="text/javascript" src="#{request.contextPath}/js/Util.js"></script>
	<title><h:outputText value="#{msgs.MSG_0036}" /></title>

	<ui:insert name="head" />
	<style type="text/css">
body {
	background-color: #eeeeee;
	font-size: 12px;
}

a:link,a:visited {
	text-decoration: none
}

a:hover {
	text-decoration: underline;
}

a:active {
	text-decoration: none
}

.iconMenuCentro {
	padding: 0px 10px 0px 10px;
}

.txtQtda {
	font-weight: bold;
}

.separator {
	margin: 15px 5px 15px 5px;
	width: 90%;
}
</style>


</h:head>
<h:body onload="quebrarTexto('span','word-wrap',2);">

	<p:ajaxStatus onstart="statusDialog.show();"
		onsuccess="statusDialog.hide();" />

	<p:dialog modal="true" widgetVar="statusDialog" minimizable="false"
		resizable="false" maximizable="false" draggable="false"
		closable="false">
		<p:graphicImage value="/imgs/ajaxloading.gif" />
		<h:outputText value="#{lbls.LBL_0060}" />
	</p:dialog>
	<p:layout fullPage="true">

		<p:layoutUnit position="north" size="80" closable="false"
			collapsible="false" id="layoutTop">
			<h:form id="formHeader" prependId="false">

				<table border="0" width="100%">

					<tr>
						<td class="iconMenuCentro" align="center"><p:commandLink>
								<p:graphicImage url="/imgs/inicio.png" />
								<h:outputText value="#{lbls.LBL_0087}" />
							</p:commandLink></td>

						<td class="iconMenuCentro" align="center">
							<p:commandLink
								rendered="#{request.isUserInRole('ROLE_TOTAL_MANTER_PESSOAS')}"
								action="manterPessoa" ajax="false">
								<p:graphicImage url="/imgs/users.png" />
								<h:outputText value="#{lbls.LBL_0088}" />
							</p:commandLink>
						</td>
						
						<td class="iconMenuCentro" align="center">
							<p:commandLink
								rendered="#{request.isUserInRole('ROLE_TOTAL_MANTER_PAPEIS_USUARIOS')}"
								action="manterPapelUsuario" ajax="false">
								<p:graphicImage url="/imgs/users.png" />
								<h:outputText value="#{lbls.LBL_0123}" />
							</p:commandLink>
						</td>

						<td class="iconMenuCentro" align="center">
							<p:commandLink
								rendered="#{request.isUserInRole('ROLE_TOTAL_MANTER_MARCAS')}"
								action="manterMarca" ajax="false">
								<p:graphicImage url="/imgs/tag_icon.png" />
								<h:outputText value="#{lbls.LBL_0089}" />
							</p:commandLink>
						</td>
						<td class="iconMenuCentro" align="center">
							<p:commandLink
								rendered="#{request.isUserInRole('ROLE_TOTAL_MANTER_GRUPOS')}"
									action="manterGrupo" ajax="false">
									<p:graphicImage url="/imgs/tube.png" />
									<h:outputText value="#{lbls.LBL_0090}" />
							</p:commandLink>
							</td>
						<td class="iconMenuCentro" align="center"><p:commandLink
								action="relatorioVendas" ajax="false">
								<p:graphicImage url="/imgs/documento.png" />
								<h:outputText value="#{lbls.LBL_0091}" />
							</p:commandLink></td>
						<td class="iconMenuCentro" align="center"><p:commandLink
							rendered="#{request.isUserInRole('ROLE_TOTAL_MANTER_PRODUTOS')}"
								action="manterProduto">
								<p:graphicImage url="/imgs/product.png" />
								<h:outputText value="#{lbls.LBL_0083}" />
							</p:commandLink></td>
						<td class="iconMenuCentro" align="center"><p:commandLink
								action="entradaProduto" ajax="false">
								<p:graphicImage url="/imgs/carrinho_reverse.png" />
								<h:outputText value="#{lbls.LBL_0092}" />
							</p:commandLink></td>
						<td class="iconMenuCentro" align="center"><p:commandLink
								action="vendaProduto" ajax="false">
								<p:graphicImage url="/imgs/carrinho.png" />
								<h:outputText value="#{lbls.LBL_0046}" />
							</p:commandLink></td>
						<td width="100%" align="right"><h:outputText
								value="#{autenticacaoMBean.usuario.pessoa.nome}" /> <br /> <h:outputText
								value="entrou como: " /> <h:outputText
								value="#{autenticacaoMBean.usuario.username}"
								style="font-weight: bold;" /> <br /> às <h:outputText
								value="#{autenticacaoMBean.usuario.dataAcessoAtual}">
								<f:convertDateTime locale="pt,BR" dateStyle="long"
									pattern="HH:mm dd/MM/yyyy " />
							</h:outputText></td>
						<td width="50px;" align="right"><h:outputLink
								value="#{request.contextPath}/logoff">
								<p:graphicImage url="/imgs/logout.png" />
								<br />
								<h:outputText value="#{lbls.LBL_0085}" />
							</h:outputLink></td>
					</tr>

				</table>

			</h:form>
		</p:layoutUnit>

		<p:layoutUnit position="west" size="180" header="#{lbls.LBL_0093}"
			resizable="false" collapsible="true" id="layoutLeft">
			<h:form id="formMenu">
				<p:menu>
					<p:submenu label="#{lbls.LBL_0088}">
						<p:menuitem value="#{lbls.LBL_0094}" action="manterPessoa"
							icon="ui-icon-squaresmall-minus" />
					</p:submenu>
					<p:submenu label="#{lbls.LBL_0089}">
						<p:menuitem value="#{lbls.LBL_0095}" action="manterMarca"
							icon="ui-icon-squaresmall-minus" />
					</p:submenu>
					<p:submenu label="#{lbls.LBL_0090}">
						<p:menuitem value="#{lbls.LBL_0096}" action="manterGrupo"
							icon="ui-icon-squaresmall-minus" />
					</p:submenu>
					<p:submenu label="#{lbls.LBL_0083}">
						<p:menuitem value="#{lbls.LBL_0097}" action="manterProduto"
							icon="ui-icon-squaresmall-minus" />
					</p:submenu>
					<p:submenu label="#{lbls.LBL_0091}">
						<p:menuitem value="#{lbls.LBL_0046}" action="relatorioVendas"
							icon="ui-icon-squaresmall-minus" />
						<p:menuitem value="#{lbls.LBL_0092}" action="relatorioCompras"
							icon="ui-icon-squaresmall-minus" />
					</p:submenu>
				</p:menu>
			</h:form>
		</p:layoutUnit>

		<p:layoutUnit position="east" size="180" header="#{lbls.LBL_0086}"
			resizable="false" collapsible="true" id="layoutRight">

			<h:form prependId="flase" id="formEstats">
				<h:outputText escape="false" style="margin-top: 10px;"
					value="#{administracaoMB.msgItensVendidos}" />
				<p:outputPanel autoUpdate="true" id="outputPanel">
					<p:separator styleClass="separator" />
					<h:outputText value="#{lbls.LBL_0100}:" />
					<table width="100%" cellpadding="0" cellspacing="0" border="0">
						<tr>
							<td style="padding-left: 5px;"><h:outputText
									value="#{lbls.LBL_0083}" /></td>
							<td width="1%"><h:outputText styleClass="txtQtda"
									value="#{administracaoMB.qtdaProduto}" /></td>
						</tr>
						<tr>
							<td style="padding-left: 5px;"><h:outputText
									value="#{lbls.LBL_0089}" /></td>
							<td><h:outputText styleClass="txtQtda"
									value="#{administracaoMB.qtdaMarcas}" /></td>
						</tr>
						<tr>
							<td style="padding-left: 5px;"><h:outputText
									value="#{lbls.LBL_0090}" /></td>
							<td><h:outputText styleClass="txtQtda"
									value="#{administracaoMB.qtdaGrupos}" /></td>
						</tr>
					</table>
				</p:outputPanel>
				<p:outputPanel
					rendered="#{not empty administracaoMB.listaProdutoAbaixoEstoque}">
					<p:separator styleClass="separator" />

					<div style="margin-top: 10px;">
						<h:outputText value="#{msgs.MSG_0034}:" />
						<h:dataTable style="width:100%;"
							value="#{administracaoMB.listaProdutoAbaixoEstoque}"
							var="produto">

							<h:column>
								<h:outputLink value="manterProduto.jsf?codProduto=#{produto.id}">
									<h:outputText value="#{produto.descricao}" />
								</h:outputLink>
							</h:column>

							<h:column>
								<h:outputText styleClass="txtQtda"
									value="#{produto.qtdaAtualEstoque}" />
							</h:column>
						</h:dataTable>
					</div>
				</p:outputPanel>
			</h:form>
		</p:layoutUnit>

		<p:layoutUnit id="layoutCenter" position="center">
			<p:growl id="mensagens" showDetail="false" autoUpdate="true" />
			<ui:insert name="centro" />
		</p:layoutUnit>

	</p:layout>

</h:body>
</html>